-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: use constants #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good!
Applies and update to use constants to avoid repetition. Signed-off-by: Ryan Johnson <[email protected]>
8f9a2f5
to
fde3d12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a few time.Sleep
s that don't use constants.
You can run a find & replace to check if there are others that may not be visible in this diff
I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
In order to have a good experience with our community, we recommend that you read the contributing guidelines for making a pull request.
Summary of Pull Request
This pull request focuses on centralizing constant values by moving them to the
constants
package and updating the codebase to use these constants. The main changes include importing theconstants
package where needed, replacing hard-coded values with constants, and adding new constants for various statuses and configurations.Centralizing Constants
hcx/constants/constants.go
: Added new constants for VMC statuses, general statuses, network profiles, locations, compute profiles, SSO provider types, and role mappings.Updating Imports
hcx/resource_compute_profile.go
: Imported theconstants
package.hcx/resource_location.go
: Imported theconstants
package.hcx/resource_rolemapping.go
: Imported theconstants
package.hcx/resource_service_mesh.go
: Imported theconstants
package.hcx/resource_sso.go
: Imported theconstants
package.hcx/resource_vcenter.go
: Imported theconstants
package.hcx/resource_vmc.go
: Imported theconstants
package.Replacing Hard-Coded Values
hcx/resource_compute_profile.go
: Replaced hard-coded status and compute type values with constants. [1] [2] [3] [4] [5] [6] [7] [8] [9]hcx/resource_location.go
: Replaced hard-coded latitude and longitude values with constants.hcx/resource_network_profile.go
: Replaced hard-coded organization value with a constant.hcx/resource_rolemapping.go
: Replaced hard-coded role values with constants. [1] [2]hcx/resource_service_mesh.go
: Replaced hard-coded status values with constants. [1] [2]hcx/resource_sso.go
: Replaced hard-coded SSO provider type value with a constant. [1] [2]hcx/resource_vcenter.go
: Replaced hard-coded status values with constants. [1] [2]hcx/resource_vmc.go
: Replaced hard-coded VMC status values and retry intervals with constants. [1] [2]Minor Improvements
hcx/resource_site_pairing.go
: Improved error messages for consistency. [1] [2]hcx/resource_sso.go
: Improved comments for clarity. [1] [2]Type of Pull Request
Please describe:
Related to Existing Issues
Issue Number: N/A
Test and Documentation Coverage
For bug fixes or features:
Breaking Changes?